package com.dkd.findmyfriends;

import java.util.List;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class ImageAdapter extends BaseAdapter {
	
    private List<ImageCardView> cards;

    public ImageAdapter(List<ImageCardView> cards) {
        this.cards = cards;
    }

    public int getCount() {
        return cards.size();
    }

    public Object getItem(int position) {
        return cards.get(position);
    }

    public long getItemId(int position) {
        return cards.get(position).getId();
    }

    // create a new ImageView for each item referenced by the Adapter
    public View getView(int position, View convertView, ViewGroup parent) {
//        ImageCardView imageView;
//        if (convertView == null) {  // if it's not recycled, initialize some attributes
//            imageView = cards.get(position);
////            imageView.setLayoutParams(new GridView.LayoutParams(120, 120));
////            imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
//            //imageView.setPadding(8, 8, 8, 8);
//        } else {
//            imageView = (ImageCardView) convertView;
//        }
//
//        //ImageCardView c = cards.get(position);
//        
//        		
////        imageView.setImageBitmap(cards.get(position).getPicture());
//        imageView = cards.get(position);
//        return imageView;
    	return cards.get(position);
    }
    
}
